/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.gitee.fdc.web.ajax;

import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author qs
 */
public class Result {

    private int code;
    private String msg;
    private Map<String, Object> data = new HashMap();

    public Result setCode(ResultCode resultCode) {
        this.code = resultCode.code;
        return this;
    }

    public int getCode() {
        return code;
    }

    public Result setCode(int code) {
        this.code = code;
        return this;
    }

    public String getMsg() {
        return msg;
    }

    public Result setMsg(String message) {
        this.msg = message;
        return this;
    }

    public Result add(String key, Object value) {
        this.data.put(key, value);
        return this;

    }

//    public Object getData() {
//	return data;
//    }
////
////    public Result setData(Object data) {
////	this.data = data;
////	return this;
////    }
    // @Override
    // public String toString() {
    // return JSON.toJSONString(this);
    // }
    public Map<String, Object> getData() {
        return data;
    }

    public Result setData(Map<String, Object> data) {
        this.data = data;
        return this;
    }
}
